Skip to content

Allow execution of a pre-build command before testing a package on Windows #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 24, 2024

The motivating change for this is swiftlang/swift-format#863.

While at it, also unify the release versions and nightly versions of Windows into a single matrix, avoiding code duplications and also making them show up in a single matrix in the GitHub workflow run, which looks nicer.

Example run: https://github.com/ahoppen/swift-format/actions/runs/11502681752

@ahoppen ahoppen requested a review from a team as a code owner October 24, 2024 14:31
@ahoppen ahoppen marked this pull request as draft October 24, 2024 15:02
@ahoppen ahoppen force-pushed the windows-pre-build branch 2 times, most recently from 95df194 to 64edffc Compare October 24, 2024 15:37
@ahoppen ahoppen marked this pull request as ready for review October 24, 2024 16:07
} else {
$Image = "swift:${{ matrix.swift_version }}-windowsservercore-ltsc2022"
}
docker pull $Image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we have save the image name as output just to remove duplication below:

Suggested change
docker pull $Image
docker pull $Image
echo "image=$Image" >> "$GITHUB_OUTPUT"

Then in the "Create test script" section we can do

docker run -v ${{ github.workspace }}:C:\source -v $env:TEMP\test-script:C:\test-script ${{ steps.pull-docker-image.outputs.image }}" C:\test-script\run.cmd

(need to set the id of the step to pull-docker-image)

See: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-output-parameter

Copy link
Member Author

@ahoppen ahoppen Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion. Updated and kicked off another test run: https://github.com/ahoppen/swift-format/actions/runs/11505824164

@ahoppen ahoppen force-pushed the windows-pre-build branch 2 times, most recently from d2dfd01 to db4d3ba Compare October 24, 2024 18:45
@ahoppen ahoppen merged commit 236a54f into swiftlang:main Oct 24, 2024
9 checks passed
@ahoppen ahoppen deleted the windows-pre-build branch October 24, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants